const playerAction =process.argv[process.argv.length-1]
console.log(playerAction)
if(playerAction !== 'rock' && playerAction !== 'paper' && playerAction !== 'scissors'){
    console.log('请输入rock、paper、scissors')
}else{
    const arr = ['rock','paper','scissors']
    const computerAction = arr[Math.floor(Math.random()*3)]

    console.log('玩家出拳：'+playerAction)
    console.log('电脑出拳：'+computerAction)
    
    if(playerAction === computerAction){
        console.log('平局')
    }else if(
        (playerAction === 'rock' && computerAction === 'paper') ||
        (playerAction === 'paper' && computerAction === 'scissors') ||
        (playerAction === 'scissors' && computerAction === 'rock')
    ){
        console.log('玩家输')
    }else{
        console.log('玩家赢')
    }
}